package com.example.chengche_lol.ui.mine;

import android.view.View;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.chengche_lol.R;
import com.example.chengche_lol.adapter.CardAdapter;
import com.example.chengche_lol.base.BaseFragment;
import com.example.chengche_lol.beans.CardBean;


public class CardFragment extends BaseFragment {

    private RecyclerView mRecyclerView;
    private CardAdapter mCardAdapter;

    @Override
    protected int rootLayout() {
        return R.layout.fragment_mine;
    }

    @Override
    protected void initView(View view) {
        mRecyclerView = view.findViewById(R.id.recyclview_part);
    }

    @Override
    protected void initData() {

        mCardAdapter = new CardAdapter();

        CardBean c1 = new CardBean(R.drawable.icon_tianyi,R.drawable.avatar_miku01,"初始之音","497","52.1%","8","46");
        mCardAdapter.addData(c1);

        CardBean c2 = new CardBean(R.drawable.icon_tianyi,R.drawable.avatar_tianyi03,"响彻未来","794","89.3%","57","94");
        mCardAdapter.addData(c2);

        CardBean c3 = new CardBean(R.drawable.icon_tianyi,R.drawable.avatar_mikumeiko,"美可美可","390","71.1%","14","31");
        mCardAdapter.addData(c3);

        CardBean c4 = new CardBean(R.drawable.icon_tianyi,R.drawable.avatar_tianyi01,"华风夏韵","214","64.6%","29","24");
        mCardAdapter.addData(c4);

    }

    @Override
    protected void bindData() {

        super.bindData();
        mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        mRecyclerView.setAdapter(mCardAdapter);

    }

    @Override
    protected void bindEvent() {

    }
}
